<?php
// +----------------------------------------------------------------------
// | ManniuRead
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://manniuyun.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: heitao <read@manniuyun.com>
// +----------------------------------------------------------------------

namespace manniu\controller;

class MemberBase extends Base{

    // 登录前允许访问的地址
    public $login_allow;
    // 登录后拒绝访问的地址
    public $logged_deny;

	/**
     * TP初始化方法
     * @access public
     */
    public function _initialize(){
    	parent::_initialize();

        // 如果当前是后台入口文件访问前台，则强制跳转到前台入口文件
        if(defined('IS_ADMIN')){
            if($this->request->pathinfo() == '' || $this->request->pathinfo() == '/'){
                $this->redirect('admin/index/index');
            }else{
                $this->redirect($this->request->domain().'/'.$this->request->pathinfo(),302);
            }
        }
    }

    /**
     * 检查会员是否登录
     */
    protected function checkLogin(){
        if($this->uid){
        	return true;
        }else{
        	return false;
        }
    }
}
